Cast uints to ints in geometry calculations. This should prevent FP
authorOwen Taylor <otaylor@redhat.com>
Mon, 1 Feb 1999 21:05:32 +0000 (21:05 +0000)
committerOwen Taylor <otaylor@src.gnome.org>
Mon, 1 Feb 1999 21:05:32 +0000 (21:05 +0000)
Mon Feb  1 14:54:28 1999  Owen Taylor  <otaylor@redhat.com>

* gtk/gtklabel.c (gtk_label_expose): Cast uints
  to ints in geometry calculations. This should
  prevent FP exceptions on FreeBSD when quantities
  become negative. [ Actually, this is probably
  a workaround with a gcc bug with handling of
  bitfields, according to Ben Jackson <ben@ben.com> ]

ChangeLog
ChangeLog.pre-2-0
ChangeLog.pre-2-10
ChangeLog.pre-2-2
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
gtk/gtklabel.c

index e81683d25b63b0958da5f14b954860e6563d46e9..27fad15951797526c28c7b75873cb37161ae802c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+Mon Feb  1 14:54:28 1999  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtklabel.c (gtk_label_expose): Cast uints
+         to ints in geometry calculations. This should
+         prevent FP exceptions on FreeBSD when quantities
+         become negative. [ Actually, this is probably
+         a workaround with a gcc bug with handling of
+         bitfields, according to Ben Jackson <ben@ben.com> ]
+
 Mon Feb  1 13:35:14 GMT 1999 Tony Gale  <gale@gtk.org>
 
        * examples/Makefile: update to new examples
index e81683d25b63b0958da5f14b954860e6563d46e9..27fad15951797526c28c7b75873cb37161ae802c 100644 (file)
@@ -1,3 +1,12 @@
+Mon Feb  1 14:54:28 1999  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtklabel.c (gtk_label_expose): Cast uints
+         to ints in geometry calculations. This should
+         prevent FP exceptions on FreeBSD when quantities
+         become negative. [ Actually, this is probably
+         a workaround with a gcc bug with handling of
+         bitfields, according to Ben Jackson <ben@ben.com> ]
+
 Mon Feb  1 13:35:14 GMT 1999 Tony Gale  <gale@gtk.org>
 
        * examples/Makefile: update to new examples
index e81683d25b63b0958da5f14b954860e6563d46e9..27fad15951797526c28c7b75873cb37161ae802c 100644 (file)
@@ -1,3 +1,12 @@
+Mon Feb  1 14:54:28 1999  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtklabel.c (gtk_label_expose): Cast uints
+         to ints in geometry calculations. This should
+         prevent FP exceptions on FreeBSD when quantities
+         become negative. [ Actually, this is probably
+         a workaround with a gcc bug with handling of
+         bitfields, according to Ben Jackson <ben@ben.com> ]
+
 Mon Feb  1 13:35:14 GMT 1999 Tony Gale  <gale@gtk.org>
 
        * examples/Makefile: update to new examples
index e81683d25b63b0958da5f14b954860e6563d46e9..27fad15951797526c28c7b75873cb37161ae802c 100644 (file)
@@ -1,3 +1,12 @@
+Mon Feb  1 14:54:28 1999  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtklabel.c (gtk_label_expose): Cast uints
+         to ints in geometry calculations. This should
+         prevent FP exceptions on FreeBSD when quantities
+         become negative. [ Actually, this is probably
+         a workaround with a gcc bug with handling of
+         bitfields, according to Ben Jackson <ben@ben.com> ]
+
 Mon Feb  1 13:35:14 GMT 1999 Tony Gale  <gale@gtk.org>
 
        * examples/Makefile: update to new examples
index e81683d25b63b0958da5f14b954860e6563d46e9..27fad15951797526c28c7b75873cb37161ae802c 100644 (file)
@@ -1,3 +1,12 @@
+Mon Feb  1 14:54:28 1999  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtklabel.c (gtk_label_expose): Cast uints
+         to ints in geometry calculations. This should
+         prevent FP exceptions on FreeBSD when quantities
+         become negative. [ Actually, this is probably
+         a workaround with a gcc bug with handling of
+         bitfields, according to Ben Jackson <ben@ben.com> ]
+
 Mon Feb  1 13:35:14 GMT 1999 Tony Gale  <gale@gtk.org>
 
        * examples/Makefile: update to new examples
index e81683d25b63b0958da5f14b954860e6563d46e9..27fad15951797526c28c7b75873cb37161ae802c 100644 (file)
@@ -1,3 +1,12 @@
+Mon Feb  1 14:54:28 1999  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtklabel.c (gtk_label_expose): Cast uints
+         to ints in geometry calculations. This should
+         prevent FP exceptions on FreeBSD when quantities
+         become negative. [ Actually, this is probably
+         a workaround with a gcc bug with handling of
+         bitfields, according to Ben Jackson <ben@ben.com> ]
+
 Mon Feb  1 13:35:14 GMT 1999 Tony Gale  <gale@gtk.org>
 
        * examples/Makefile: update to new examples
index e81683d25b63b0958da5f14b954860e6563d46e9..27fad15951797526c28c7b75873cb37161ae802c 100644 (file)
@@ -1,3 +1,12 @@
+Mon Feb  1 14:54:28 1999  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtklabel.c (gtk_label_expose): Cast uints
+         to ints in geometry calculations. This should
+         prevent FP exceptions on FreeBSD when quantities
+         become negative. [ Actually, this is probably
+         a workaround with a gcc bug with handling of
+         bitfields, according to Ben Jackson <ben@ben.com> ]
+
 Mon Feb  1 13:35:14 GMT 1999 Tony Gale  <gale@gtk.org>
 
        * examples/Makefile: update to new examples
index 7c3fc744ea86ca9446b980ca5f8caae885712a59..d24165749540eeb585af3e2f44840d51a8294415 100644 (file)
@@ -927,14 +927,16 @@ gtk_label_expose (GtkWidget      *widget,
       gdk_gc_set_clip_rectangle (widget->style->white_gc, &event->area);
       gdk_gc_set_clip_rectangle (widget->style->fg_gc[widget->state], &event->area);
       
-      x = floor (widget->allocation.x + misc->xpad +
-                ((widget->allocation.width - label->max_width - 2 * misc->xpad) 
-                 * misc->xalign) + 0.5);
-      
-      y = floor (widget->allocation.y
-                + (widget->allocation.height
-                   - widget->requisition.height) * misc->yalign
-                + misc->ypad + 0.5);
+      x = floor (widget->allocation.x + (gint)misc->xpad
+                + (((gint)widget->allocation.width - 
+                   (gint)label->max_width - 2 * (gint)misc->xpad)
+                   * misc->xalign) + 0.5);
+      
+      y = floor (widget->allocation.y + (gint)misc->ypad 
+                + (((gint)widget->allocation.height
+                    - (gint)widget->requisition.height)
+                   * misc->yalign) + 0.5);
+
       for (word = label->words; word; word = word->next)
        {
          gchar save = word->beginning[word->length];